package routines;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

@Entity
@Table(name = "contactinfo")
public class ContactInfo {


	private long contactinfoId;
	private String email;
	private String phone;
	private String lastname;
	private String firstname;
	private String middlename;
	private String fax;
	
	private LegalEntity legalentity;
	
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "legalentity_id", nullable = true)
	public LegalEntity getLegalentity() {
		return legalentity;
	}

	public void setLegalentity(LegalEntity legalentity) {
		this.legalentity = legalentity;
	}
	
	public ContactInfo(){};
	

	
	@Id
	@GeneratedValue(strategy = GenerationType.AUTO, generator = "seq_contactinfo_gen")
	@SequenceGenerator(name = "seq_contactinfo_gen", sequenceName = "seq_contactinfo")
	@Column(name = "contactinfo_id")
	public long getContactinfoId() {
		return contactinfoId;
	}


	public void setContactinfoId(long contactinfoId) {
		this.contactinfoId = contactinfoId;
	}

	
	
	@Column(name = "email", columnDefinition = "TEXT")
	public String getEmail() {
		return this.email;
	}

	public ContactInfo setEmail(String email) {
		this.email = email;
		return this;
	}

	@Column(name = "phone", columnDefinition = "TEXT")
	public String getPhone() {
		return this.phone;
	}

	public ContactInfo setPhone(String phone) {
		this.phone = phone;
		return this;
	}

	@Column(name = "lastname", columnDefinition = "TEXT")
	public String getLastname() {
		return this.lastname;
	}

	public ContactInfo setLastname(String lastname) {
		this.lastname = lastname;
		return this;
	}

	@Column(name = "firstname", columnDefinition = "TEXT")
	public String getFirstname() {
		return this.firstname;
	}

	public ContactInfo setFirstname(String firstname) {
		this.firstname = firstname;
		return this;
	}

	@Column(name = "middlename", columnDefinition = "TEXT")
	public String getMiddlename() {
		return this.middlename;
	}

	public ContactInfo setMiddlename(String middlename) {
		this.middlename = middlename;
		return this;
	}

	@Column(name = "fax", columnDefinition = "TEXT")
	public String getFax() {
		return this.fax;
	}

	public ContactInfo setFax(String fax) {
		this.fax = fax;
		return this;
	}


	
}
